package at.guigu.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")
public class BookController {

    @Value("${name}")
    private String name;
    @Value("${a.b.c}")
    private Integer c;
    @Value("${a.b.arrayOne[0]}")
    private String arrOne;
    @Value("${e.arrayTwo[0]}")
    private String arrTwo;

    @GetMapping("/{id}")
    public String getById(@PathVariable(value = "id") Integer id) {
        System.out.println("id===>" + id);
        System.out.println("name===>" + name);
        System.out.println("c===>" + c);
        System.out.println("arrOne===>" + arrOne);
        System.out.println("arrTwo===>" + arrTwo);
        return "Hello SpringBoot!!!";
    }
}